const axios = require('axios')

/**
 * 数据请求
 * @param url
 * @param method
 * @param data
 * @returns {AxiosPromise | *}
 */
const request = (url,method,data) => {
    if (method.toUpperCase() === "GET") {
        return axios({
            url:url,
            method:method,
            params:data
        })
    } else {
        return axios({
            url:url,
            method:method,
            data:data
        })
    }
}

module.exports = {request}
